package org.example.common.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Date;
import java.sql.Timestamp;

/**
 * 用户实体类，表示租户内的用户信息。
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {

    private Long userId;  // 用户ID
    private Long tenantId;  // 租户ID
    private Long departmentId;  // 部门ID
    private String openId;  //
    private String username;  // 用户名
    private String password;  // 密码
    private String fullName;  // 用户全名
    private String email;  // 用户邮箱
    private String phoneNumber;  // 电话号码
    private String status;  // 用户状态
    private Timestamp createdAt;  // 创建时间
    private Timestamp updatedAt;  // 更新时间
    private Timestamp deletedAt;  // 逻辑删除时间
    private String tokenValue;  // token


    public  User setTokenValue(String newTokenValue) {
        this.tokenValue = newTokenValue;
        return this;
    }

    public User setTenantId(Long tenantId) {
        this.tenantId = tenantId;
        return this;
    }

    public User setDepartmentId(Long departmentId) {
        this.departmentId = departmentId;
        return this;
    }

    public User setOpenId(String openId) {
        this.openId = openId;
        return this; // 确保返回 this
    }

    public User setUsername(String username) {
        this.username = username;
        return this; // 确保返回 this
    }

    public User setPassword(String password) {
        this.password = password;
        return this; // 确保返回 this
    }

    public User setFullName(String fullName) {
        this.fullName = fullName;
        return this; // 确保返回 this
    }

    public User setEmail(String email) {
        this.email = email;
        return this; // 确保返回 this
    }

    public User setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
        return this; // 确保返回 this
    }

    public User setStatus(String status) {
        this.status = status;
        return this; // 确保返回 this
    }

    public User setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
        return this; // 确保返回 this
    }

    public User setUpdatedAt(Timestamp updatedAt) {
        this.updatedAt = updatedAt;
        return this; // 确保返回 this
    }
}